﻿Imports DAO
Imports DTO
Public Class HoaDonBUS
    Dim hd As New HoaDonDAO


    Function LoadDSNV() As DataTable
        Return hd.loadDSHD()
    End Function

    Public Shared Function loadDS()
        Dim ds As New HoaDonDAO()
        Return ds.LoadDsHD()
    End Function

    Public Shared Function laytheoid(ByVal id As Integer) As HoaDonDTO
        Dim dthd As New HoaDonDAO()
        Return dthd.LAYTHEOID(id)
    End Function


    Public Shared Function laytatca() As IList
        Dim hdDAO As New HoaDonDAO()
        Return hdDAO.layTatCa()
    End Function

    Public Shared Function layTatCaTB() As DataTable
        Dim hdDAO As New HoaDonDAO()
        Return hdDAO.layTatCaTB()
    End Function

    Public Shared Sub ThemHD(ByVal hd As HoaDonDTO)
        Dim hdDao As New HoaDonDAO()
        hdDao.Them(hd)
    End Sub

    Shared Function DoanhThu(ByVal ngaydau As Date, ByVal ngaycuoi As Date) As DataTable
        Dim dt As New DataTable
        Dim dthu As New HoaDonDAO
        dt = dthu.DoanhThu(ngaydau, ngaycuoi)
        Return dt
    End Function

    Shared Function layKHtheoid() As DataTable
        Dim lDAO As New HoaDonDAO()
        Return lDAO.LayTatCaTT()
    End Function

    Shared Sub XOA(ByVal id As Integer)
        Dim hdDAO As New HoaDonDAO()
        hdDAO.Xoa(id)
    End Sub



End Class
